import sys
from solution import Solution


def test():
    sol = Solution()
    test_cases = [
        ([1, 2, 3, 4, 5], 3, 12),
        ([1, 3, 5, 7], 3, 0),
        ([2, 4, 6, 8], 3, 18),
        ([1, 1, 1, 1, 2, 2], 4, 6),
        ([5, 5, 5, 5, 5], 4, 20),
    ]

    for i, (cards, cnt, expected) in enumerate(test_cases):
        result = sol.maximumScore(cards, cnt)
        assert result == expected, f"Case {i} failed: expected {expected}, got {result}"
    print("All tests passed!")


if __name__ == "__main__":
    test()
